/*
 * Copyright (c) 2002-2004, xRhino, Inc.
 *
 * This library is free software; you can redistribute and/or modify
 * it under the terms of the dual license distributed with this source
 * package (a combined Trolltech QPL/GPL-compatible license)
 *
 * Under this dual license scheme, a separate license is available for use of 
 * this code with a proprietary (closed) system. For more information on the 
 * license, please see the LICENSE file distributed with this source package.
 */
#ifndef SUGPATHSEG_H
#define SUGPATHSEG_H

#include "SugTypes.h"

/**
 * This is a list of all path segment types from the SVG IDL.
 */
enum {PATHSEG_UNKNOWN = 0,
      PATHSEG_CLOSEPATH = 1,
      PATHSEG_MOVETO_ABS = 2,
      PATHSEG_MOVETO_REL = 3,
      PATHSEG_LINETO_ABS = 4,
      PATHSEG_LINETO_REL = 5, 
      PATHSEG_CURVETO_CUBIC_ABS = 6,
      PATHSEG_CURVETO_CUBIC_REL = 7, 
      PATHSEG_CURVETO_QUADRATIC_ABS = 8,
      PATHSEG_CURVETO_QUADRATIC_REL = 9,
      PATHSEG_ARC_ABS = 10,
      PATHSEG_ARC_REL = 11,
      PATHSEG_LINETO_HORIZONTAL_ABS = 12,
      PATHSEG_LINETO_HORIZONTAL_REL = 13,
      PATHSEG_LINETO_VERTICAL_ABS = 14,
      PATHSEG_LINETO_VERTICAL_REL = 15,
      PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16,
      PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17,
      PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18,
      PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19};
/**
 * This is the base class of all path segments.
 */
class SugPathSeg
{
  protected:
   /**
    * This is the path segment type.  With it we know what to cast each 
    * segment that comes out of the segment vector in SugPathElement.
    */
    unsigned short mPathSetType;

   /**
    * This is from the SVG IDL and is currently unused.
    */
   char* mPathSegTypeAsLetter;

   /**
    * All path segments at least have an x and a y.  This is the x
    * component.
    */
   SugRealType mX;

   /**
    * All path segments at least have an x and a y.  This is the y 
    * component.
    */
   SugRealType mY;

  public:

   /**
    * Returns the path segment type.  This is used for casting.
    */
    unsigned short getPathSegType();

   /**
    * This is from the SVG IDL and is currently unused.
    */
   char* getPathSegTypeAsLetter();

   /**
    * Sets the path segment type.
    */
   unsigned short setPathSegType(unsigned short newPathSegType);

   /**
    * Sets the path segment type as letter member, currently unused.
    */
   char* setPathSetTypeAsLetter(char* newPathSegTypeAsLetter);

   /**
    * Returns the x component.
    */
   SugRealType getX();

   /**
    * Returns the y component.
    */
   SugRealType getY();

   /**
    * Sets the x component.
    */
   SugRealType setX(SugRealType newX);

   /**
    * Sets the y component.
    */
   SugRealType setY(SugRealType newY);

   /**
    * The class constructor.
    */
   SugPathSeg();

   /**
    * The class destructor.
    */
   ~SugPathSeg();

};

#endif
